import 'package:flutter/material.dart';
import 'package:wy/pages/home/banner.dart';
import 'package:wy/pages/home/category.dart';
import 'package:wy/utils/screen_util.dart';
import 'package:wy/utils/system_util.dart';
import 'package:wy/widgets/global_navigation_bar.dart';
import 'package:wy/widgets/recommand_list.dart';
import 'package:wy/widgets/song_list.dart';

import 'header.dart';

const songList1 = [
  {
    'id': '43423',
    'img': 'assets/images/tmp_cover_1.jpg',
    'count': '9亿',
    'title': '[华语新歌] 最新华语音乐专辑|最快最多最好最什么'
  },
  {
    'id': '666',
    'img': 'assets/images/tmp_cover_2.jpg',
    'count': '39.4亿',
    'title': '今天从《Titan》听起|私人雷达'
  },
  {
    'id': '231',
    'img': 'assets/images/tmp_cover_3.jpg',
    'count': '16亿',
    'title': 'aaa'
  },
  {
    'id': '333',
    'img': 'assets/images/tmp_cover_4.jpg',
    'count': '5321',
    'title': 'bbb'
  },
  {
    'id': '788',
    'img': 'assets/images/tmp_cover_5.jpg',
    'count': '19万',
    'title': 'ccc'
  },
  {
    'id': '344',
    'img': 'assets/images/tmp_cover_6.jpg',
    'count': '565',
    'title': 'dddd'
  },
];

const recommendList1 = [
  {
    'id': '1111',
    'img': 'assets/images/tmp_cover_1.jpg',
    'title': 'Tempest',
    'artist': 'Capo Productions',
    'tip': '你到不了的地方 音乐能带你去'
  },
  {
    'id': '1111',
    'img': 'assets/images/tmp_cover_2.jpg',
    'title': '岁月神偷',
    'artist': '金玟岐',
    'tip': 'aaa'
  },
  {
    'id': '1111',
    'img': 'assets/images/tmp_cover_3.jpg',
    'title': '最美的期待',
    'artist': '周笔畅',
    'tip': 'bbb'
  },
  {
    'id': '1111',
    'img': 'assets/images/tmp_cover_4.jpg',
    'title': '遥远的你',
    'artist': 'xxxx',
    'tip': 'xxx'
  },
  {
    'id': '1111',
    'img': 'assets/images/tmp_cover_5.jpg',
    'title': '遥远的你',
    'artist': 'xxxx',
    'tip': 'xxx'
  },
  {
    'id': '1111',
    'img': 'assets/images/tmp_cover_6.jpg',
    'title': '遥远的你',
    'artist': 'xxxx',
    'tip': 'xxx'
  },
];

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    var screen = Screen(context);
    setStatusBarStyle(Brightness.light);
    return Scaffold(
      body: DefaultTextStyle(
        style: TextStyle(
          color: Color(0xff333333),
        ),
        child: SingleChildScrollView(
          child: Container(
            decoration: BoxDecoration(
              color: Colors.white,
            ),
            padding: EdgeInsets.only(top: screen.top + screen.calc(7)),
            child: Column(
              children: [
                Header(),
                HBanner(),
                HCategory(),
                HSongList(
                  title: '推荐歌单',
                  onMore: () {
                    print('点击查看更多');
                  },
                  items: songList1,
                ),
                HRecommendList(
                  tilte: '走过华语音乐街',
                  onMore: () {
                    print('点击播放全部');
                  },
                  items: recommendList1,
                  onPlay: (id) {
                    print('id$id');
                  },
                ),
                Container(
                  height: screen.calc(100),
                ),
              ],
            ),
          ),
        ),
      ),
      bottomNavigationBar: GlobalNavigationBar(
        value: 0,
      ),
    );
  }
}
